#if !defined MENU_H
#define MENU_H

#include "SeqList.h"
#include "Student.h"
#include "Teacher.h"
#include "Book.h"
#include "Librarian.h"
#include "BorrowRecord.h"
#include "BRSeqList.h"

class Menu
{public:
   virtual void start()=0;
   virtual void handleMenu()=0;
protected:
   virtual char menuSelect()=0;
};

class adminMenuI:public Menu
{public:
   virtual void start();
   virtual void handleMenu();
protected:
   virtual char menuSelect();
};

class adminMenuII_Book:public adminMenuI
{public:
   virtual void start();
   virtual void handleMenu();
protected:
   virtual char menuSelect();
   SeqList<Book> book;
};

class adminMenuII_Stud:public adminMenuI
{public:
   virtual void start();
   virtual void handleMenu();
protected:
   virtual char menuSelect();
   SeqList<Student> student;
};

class adminMenuII_Teach:public adminMenuI
{public:
   virtual void start();
   virtual void handleMenu();
protected:
   virtual char menuSelect();
   SeqList<Teacher> teacher;
};

class adminMenuII_Lib:public adminMenuI
{public:
   virtual void start();
   virtual void handleMenu();
protected:
   virtual char menuSelect();
   SeqList<Librarian> librarian;
};

class adminMenuII_BR:public adminMenuI
{public:
   virtual void start();
   virtual void handleMenu();
protected:
   virtual char menuSelect();
   SeqList<BorrowRecord> borrowrecord;
};

class studMenu:public Menu
{public:
	studMenu(string userNum);
    virtual ~studMenu();
    void start();
	void handleMenu();
    void loadRecords();
	void queryBookInformation();
	void queryPersonalInformation();
	void queryBorrowRecord();
	void modifyPassword();
	bool backSpace();
protected:
	char menuSelect();
private:
	string userNum;
	string reader_type;
	SeqList<Student> student;
	SeqList<Book> book;
	SeqList<BorrowRecord> borrowRec;
};

class teachMenu:public Menu
{public:
	teachMenu(string userNum);
    virtual ~teachMenu();
    void start();
	void handleMenu();

    void loadRecords();
	void queryBookInformation();
	void queryPersonalInformation();
	void queryBorrowRecord();
	void modifyPassword();
	void backSpace();
protected:
	char menuSelect();
private:
	string userNum;
	string reader_type;
	SeqList<Teacher> teacher;
	SeqList<Book> book;
	SeqList<BorrowRecord> borrowRec;
};

class libMenu:public Menu
{public:
    libMenu(string userNum);
	virtual ~libMenu();
    virtual void start();
    virtual void handleMenu();
    void borrowBook();
	void returnBook();
    void queryExpireBook();
	void updatePassword();
	void displayRecords();
	void sortRecords();
	void saveRecords();
	void loadRecords();
protected:
    char menuSelect();
	void dispRecord(BorrowRecord rec);
private:
	string userNum;
	string reader_type;
	bool isModified;
	SeqList<Student> student;
	SeqList<Teacher> teacher;
	SeqList<Book> book;
	BRSeqList borrowRec;
    SeqList<Librarian> lib;
};
#endif // MENU_H
